<template>
  <div>
    <!-- <v-divider class="mb-5"></v-divider> -->
    <v-textarea class="ml-5 mr-5" outlined name="input-7-4" label="按 Enter 发送" v-model="content" @keyup.enter.native="keyUp"> </v-textarea>
  </div>
</template>

<script>
import axios from "axios";
export default {
  props: ["messageInfo"],
  data() {
    return {
      content: "",
    };
  },
  methods: {
    keyUp() {
      const that = this;
      axios
        .post(
          "/api/message/",
          {
            receiver: this.messageInfo.info.id,
            content: that.content,
          },
          {
            headers: {
              Authorization: "Bearer " + localStorage.getItem("access"),
            },
          }
        )
      this.content = "";
      this.$store.commit('refreshList')
    },
  },
};
</script>

<style></style>
